package 剑指Offer1;

public class _12缺失的数字 {
    public int missingNumber(int[] nums) {
        if(nums == null || nums.length == 0) return 0;
        int i=0;
        int j = nums.length - 1;
        while(i<=j){
            int m = (i+j) >> 1;
            if(nums[m] == m){
                i = m + 1;
            }else{
                j = m - 1;
            }
        }
        return i;
    }
}
